package com.infore.siteManagement.PlatformInvocationServices.remoteController;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.infore.siteManagement.PlatformInvocationServices.Service.RemoteControlAndStationManageService;
import com.infore.siteManagement.util.ResultEntity;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

/**
 * 
 * @author llf
 *远程调用控制层
 *
 */

@Api(value = "远程控制服务与站点管理服务", tags = {"远程控制服务与站点管理服务"})
@RestController
@RequestMapping("/remoteAndStation")
public class RemoteControlAndStationManageController {

	@Autowired
	private RemoteControlAndStationManageService remoteControlAndStationManageService;
	/**
	 * 传入站点id返回协议信息
	 * @param stationId
	 * @return
	 */
	@ApiOperation(value = "根据站点查询协议接口")
	@ApiImplicitParams(@ApiImplicitParam(value = "站点id", name = "stationId", paramType = "query",required = true,dataType = "String"))
	@GetMapping(value = "/protocols")
	public ResultEntity findProtocols(String stationId) {
		return remoteControlAndStationManageService.findProtocols(stationId);
	}
	/**
	 * 传入设备id返回指令信息
	 * @param equipmentId
	 * @return
	 */
	@ApiOperation(value = "根据设备查询指令接口")
	@GetMapping(value = "/equipments")
	public ResultEntity findInstructions(@RequestParam(value="equipmentId", required=true)String equipmentId) {
		return remoteControlAndStationManageService.findInstructions(equipmentId);
	}
}

